<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f"%>
<%@ taglib uri="/mytag" prefix="yjd"%>
<div class="wrap" >
    <div class="h_a">搜索</div>
    <form
            action="${requestScope.FPWEB.rootPath }/project/all${requestScope.FPWEB.urlStuff}"
            method="get" autocomplete="off">
        <div class="search_type cc">
            <label>项目名称：</label><input name="project_name_like" type="text"
                                     class="input length_3 mr10" value="${maps.project_name_like}"
                                     placeholder="项目名称">
            <button type="submit" class="btn btn_submit length_1">搜索</button>
            <button type="button" class="btn  length_2" onclick="window.location.href='${requestScope.FPWEB.rootPath }/project/add${requestScope.FPWEB.urlStuff}'">发布新项目</button>
        </div>
    </form>
    <div class="table_list">
        <c:set var="hashData"
               value="${models!=null && fn:length(models)>1 }" />
        <table width="100%">
            <thead>
            <tr>
                <td>项目ID</td>
                <td>项目名称</td>
                <td>所属机构</td>
                <td>项目价格</td>
                <td>售卖价格</td>
                <td>首付金额</td>
                <td>可贷金额</td>
                <td>负责医生</td>
                <td>预约数</td>
                <td>浏览次数</td>
                <td>添加时间</td>
                <td>最后更新时间</td>
                <td>状态</td>
                <td>操作</td>
            </tr>
            </thead>
            <tbody id="J_word_list">
            <c:forEach items="${pager.pagerModel.dataList }" var="item" varStatus="i">
                <tr>
                    <td>${item.project_id}</td>
                    <td>${item.project_name}</td>
                    <td>${item.strMap.org_name}</td>
                    <td>${item.project_price}</td>
                    <td>${item.act_price}</td>
                    <td>${item.payment}</td>
                    <td>${item.loan_price}</td>
                    <td>${item.strMap.doctor_name}</td>
                    <td>${item.reservation_count}</td>
                    <td>${item.view_count}</td>
                    <td>${item.strMap.create_time}</td>
                    <td>${item.strMap.last_update_time}</td>
                    <td><c:if test="${item.is_used==0}">下架</c:if><c:if test="${item.is_used==1}">可用</c:if></td>
                    <td>
                        <%--<a href="${requestScope.FPWEB.rootPath }/project/detail${requestScope.FPWEB.urlStuff}?id=${item.project_id}" class="btn mr10">查看</a>--%>
                        <a class="btn btn_submit btn_orange " href="${requestScope.FPWEB.rootPath }/project/edit${requestScope.FPWEB.urlStuff}?id=${item.project_id}">修改</a>
                       <c:if test="${item.is_used==0}">
                           <a class="btn btn_submit J_ajax_del" href="${requestScope.FPWEB.rootPath }/project/open${requestScope.FPWEB.urlStuff}?id=${item.project_id}" data-msg="确定上架？" >上架</a>
                       </c:if>
                        <c:if test="${item.is_used==1}">
                           <a class="btn btn_submit J_ajax_del" href="${requestScope.FPWEB.rootPath }/project/close${requestScope.FPWEB.urlStuff}?id=${item.project_id}" data-msg="确定下架？">下架</a>
                        </c:if>
                        <a class="btn btn_submit btn_orange " href="${requestScope.FPWEB.rootPath }/project/editRate${requestScope.FPWEB.urlStuff}?id=${item.project_id}">配置利率</a>
                    </td>
                </tr>
            </c:forEach>
            </tbody>
        </table>
    </div>
    <!-- 分页 -->
    <%@ include file="../public/pager/pager.pagination.jsp" %>
</div>
